<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增会员资料')" />
    <th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-profile-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">会员Id：</label>
                <div class="col-sm-8">
                    <input name="memberId" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">手机号：</label>
                <div class="col-sm-8">
                    <input name="phone" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">usdt地址：</label>
                <div class="col-sm-8">
                    <textarea name="usdtAddress" class="form-control" required></textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">开户银行：</label>
                <div class="col-sm-8">
                    <input name="bankAccount" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">银行卡号：</label>
                <div class="col-sm-8">
                    <input name="bankCard" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">开户名称：</label>
                <div class="col-sm-8">
                    <input name="accountName" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">支付宝收款码：</label>
                <div class="col-sm-8">
                    <input type="hidden" name="alipayPaymentCode">
                    <div class="file-loading">
                        <input class="form-control file-upload" id="alipayPaymentCode" name="file" type="file">
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">微信收款码：</label>
                <div class="col-sm-8">
                    <input type="hidden" name="wechatPaymentCode">
                    <div class="file-loading">
                        <input class="form-control file-upload" id="wechatPaymentCode" name="file" type="file">
                    </div>
                </div>
            </div>

        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: bootstrap-fileinput-js"/>
    <script th:inline="javascript">
        var prefix = ctx + "member/profile"
        $("#form-profile-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-profile-add').serialize());
            }
        }

        $(".file-upload").fileinput({
            uploadUrl:  ctx+'common/upload',
            maxFileCount: 1,
            autoReplace: true
        }).on('fileuploaded', function (event, data, previewId, index) {
            $("input[name='" + event.currentTarget.id + "']").val(data.response.url)
        }).on('fileremoved', function (event, id, index) {
            $("input[name='" + event.currentTarget.id + "']").val('')
        })
    </script>
</body>
</html>